import request from '@/utils/request'

// 给员工分配角色
export const assignRoleForemployee = data => request({
  url: `/sys/user/assignRoles`,
  method: 'put',
  data
})

// 获取权限
export const getPermissionList = params => request({
  url: '/sys/permission',
  params
})
// 新增权限
export const addPermission = data => request({
  url: '/sys/permission',
  method: 'post',
  data
})

// 更新权限
export const updatePermission = data => request({
  url: `/sys/permission/${data.id}`,
  method: 'put',
  data
})

// 删除权限
export const delPermission = id => request({
  url: `/sys/permission/${id}`,
  method: 'delete'
})
// 获取权限详情
export const getPermissionDetail = id => request({
  url: `/sys/permission/${id}`
})
// 给角色分配权限
export const assignPermission = data => request({
  url: '/sys/role/assignPrem',
  method: 'put',
  data
})

